{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Practical Statistics for Data Scientists (Python)\n",
    "# Chapter 2. Data and Sampling Distributions\n",
    "> (c) 2019 Peter C. Bruce, Andrew Bruce, Peter Gedeck"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Import required Python packages."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "from pathlib import Path\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from scipy import stats\n",
    "from sklearn.utils import resample\n",
    "\n",
    "import seaborn as sns\n",
    "import matplotlib.pylab as plt\n",
    "\n",
    "DATA = Path('.').resolve().parents[1] / 'data'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Define paths to data sets. If you don't keep your data in the same directory as the code, adapt the path names."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "LOANS_INCOME_CSV = DATA / 'loans_income.csv'\n",
    "SP500_DATA_CSV = DATA / 'sp500_data.csv.gz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Figure 2.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAASUAAABfCAYAAACuqdFkAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHT0lEQVR4nO3df+hfUxzH8edsfuwn28IMOUt+7wf5bZb8WKk7QjKyRNaSMRvDkcjy65OF/P6RrJX2hyKawx/7x4gURaL4y8cfIlKKSLT5415saz8+3+/n3vs+59zXo/bfvve8at+9uvecc88ds3XrVkREYrGXdQARkW2plEQkKiolEYmKSkl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c1GW49vuy2larJ6GnA0MBuYB5wGnIQez3LxFfAR5UkNXwBfA9/3e8UW01S7oVKKRxNFtadiGQ/sDXxT/dlYdwCJ0hTgl7YH1bJ+epr4NzM/T0nkX7oDysOwpaR3pkQkKpoXEjO6M5Kd0eObiERFj28iEhWVkohERaUkIlFRKYlIVFRKIhIVlZKIROUftoCVmWY5SNwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x108 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(seed=1)\n",
    "x = np.linspace(-3, 3, 300)\n",
    "xsample = stats.norm.rvs(size=1000)\n",
    "\n",
    "fig, axes = plt.subplots(ncols=2, figsize=(5, 1.5))\n",
    "\n",
    "ax = axes[0]\n",
    "ax.fill(x, stats.norm.pdf(x))\n",
    "ax.set_axis_off()\n",
    "ax.set_xlim(-3, 3)\n",
    "\n",
    "ax = axes[1]\n",
    "ax.hist(xsample, bins=30)\n",
    "ax.set_axis_off()\n",
    "ax.set_xlim(-3, 3)\n",
    "ax.set_position\n",
    "# plt.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, hspace=0)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sampling Distribution of a Statistic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "         income  type\n",
      "40292   63000.0  Data\n",
      "38959   92000.0  Data\n",
      "17361  134000.0  Data\n",
      "33996   52000.0  Data\n",
      "26491   43000.0  Data\n"
     ]
    }
   ],
   "source": [
    "loans_income = pd.read_csv(LOANS_INCOME_CSV, squeeze=True)\n",
    "\n",
    "sample_data = pd.DataFrame({\n",
    "    'income': loans_income.sample(1000),\n",
    "    'type': 'Data',\n",
    "})\n",
    "\n",
    "sample_mean_05 = pd.DataFrame({\n",
    "    'income': [loans_income.sample(5).mean() for _ in range(1000)],\n",
    "    'type': 'Mean of 5',\n",
    "})\n",
    "\n",
    "sample_mean_20 = pd.DataFrame({\n",
    "    'income': [loans_income.sample(20).mean() for _ in range(1000)],\n",
    "    'type': 'Mean of 20',\n",
    "})\n",
    "\n",
    "results = pd.concat([sample_data, sample_mean_05, sample_mean_20])\n",
    "print(results.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARkAAAGoCAYAAAByhpHHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAf30lEQVR4nO3dfbAddZ3n8feH8KSAJJFsKpWEDWhczTBKshdBQAukcEOc3aCDPCwFGRZNrQZLNkoZpbZwduaPuDLIBB8waoZkhiXyuARhyWCIqDuSEDEkBMgkKiluJuRBnYDiwyZ894/+Xejc3HtP33vP75xzO59X1anT59fdp7/NufnQv+7Tv6OIwMwsl8PaXYCZ1ZtDxsyycsiYWVYOGTPLyiFjZlk5ZMwsK4eMDZuk/ZLWS9ok6SlJn5Y04N+WpCmS/nOrarT2cchYM/wuIk6NiD8BzgcuAG5osM4UwCFzCJC/jGfDJek3EXFs6fXJwBPACcC/Bf4eOCbNviYi/knS48A7gF8AS4H7+lquRbtgGTlkbNh6h0xq+1fg3wEvA69GxO8lTQXuiIguSecAn4mIP0vLv7Gv5Vq5H5bH4e0uwGrvCOArkk4F9gNvG+ZyNsI4ZKzpUndpP7CL4tzMTuBdFOcAf9/Pav+t4nI2wvjErzWVpHHArcBXouiLHw/siIhXgSuAUWnRl4HjSqv2t5yNcD4nY8MmaT+wkaLLs4/iBO5NEfFqOr9yDxDAw8C8iDhW0hHASuDNwG3Ad/tartX7Ys3nkDGzrN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7em+ScPYx/OpuimbADWp8esTv0sfFuBmWVV5+6SmXUAh4yZZeWQMbOsHDJmlpVDxsyycshYZZJ+0+4abORxyJhZVg4ZGzRJ50j6vqS7JT0n6fbSeCOnSfonSU9JWivpOElHS/q7ND7JTyWdm5b9C0n/O41L8rykayTNT8s8LmlsWu4tkh5ON5T+UNLb27n/NjgdM5C4jTjTgT8B/gX4v8BZktYC3wEuiYgnJL0J+B3wKYr76f40BcQ/Snpbep9T0nsdTfGt089GxHRJX6b4OvvNFANe/9eI2CLpdOBrwPtbtaM2PA4ZG6q1EdENIGk9xRgte4EdEfEEQKQ7gyWdDdyS2p6TtA3oCZnVEfEy8LKkvcADqX0j8M50p/GZwF16fYC/o/LumjWTQ8aG6g+l6f0M/W+p/D6vll6/mt7zMIoxWk4d4vtbm/mcjDXTZmCCpNMA0vmYw4EfApentrcBJ6ZlG0pHQ7+Q9JG0viS9K0fxlodDxpomIv4IXALcIukp4BGKcy1fAw6TtJHinM1fRMQf+n+ng1wOXJ3ecxMwu7mVW06+C9vMsvKRjJll5ZAxs6wcMmaWlUPGzLJyyJhZVg4ZM8vKIWNmWf1/oOgXy92ghC4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x432 with 3 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "g = sns.FacetGrid(results, col='type', col_wrap=1, \n",
    "                  height=2, aspect=2)\n",
    "g.map(plt.hist, 'income', range=[0, 200000], bins=40)\n",
    "g.set_axis_labels('Income', 'Count')\n",
    "g.set_titles('{col_name}')\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The Bootstrap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bootstrap Statistics:\n",
      "original: 62000.0\n",
      "bias: -82.09799999999814\n",
      "std. error: 228.73933106830927\n"
     ]
    }
   ],
   "source": [
    "results = []\n",
    "for nrepeat in range(1000):\n",
    "    sample = resample(loans_income)\n",
    "    results.append(sample.median())\n",
    "results = pd.Series(results)\n",
    "print('Bootstrap Statistics:')\n",
    "print(f'original: {loans_income.median()}')\n",
    "print(f'bias: {results.mean() - loans_income.median()}')\n",
    "print(f'std. error: {results.std()}')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Confidence Intervals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "68760.51844\n",
      "55734.1\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAADQCAYAAADcQn7hAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgoUlEQVR4nO3deXhU5fXA8e9J2DcTdgqyCQImQoQAirhAjKxiK8iitqi4tCCK1gWrLVq1ouJCa62iKKgIKqBEQBAUl1p/QKJhU5CIQcMaEqMsgWzn98e9GSesE8jNTCbn8zzz5M57t5OZm5P3vvfe9xVVxRhjvBAR7ACMMeHLEowxxjOWYIwxnrEEY4zxjCUYY4xnLMEYYzzjaYIRkdtFZIOIrBeR2SJSQ0TaiMhKEUkTkTdFpJqXMRhjgsezBCMizYFbgXhVjQUigZHAY8DTqtoO+AkY41UMxpjg8voUqQpQU0SqALWAHUBfYK47fybwW49jMMYESRWvNqyq20RkCvADkAt8AKQAOapa4C6WATQ/2voichNwE0Dt2rW7dezY0atQjTGlkJKSskdVGwWyrGcJRkSigcuBNkAO8DbQP9D1VXUaMA0gPj5ek5OTPYjSGFNaIrI10GW9PEW6BPheVTNVNR+YD5wPRLmnTAAtgG0exmCMCSIvE8wP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VKe7DYr0U+LwixI2TYH7ESWhV3OO7XzCP78p4ivQMcDdQ5L5vAOSoaoH7PgPni4JfvzDc+T+7y/vKD1vnWOVlQYEPRCRFnMcoAJqo6g53eifQ5PC4A4yvuTtd1nG3ATKBV8Q5JX1JRGpXgLj9jQRmu9MhHbeqbgOmAD8AO3CO1xSCeHxXqgQjIoOB3aqaEuxYTkJvVe0KDADGiciF/jPV+ZcSavccVAG6Av9R1XOA/TinFj4hGjcAblvFEODtw+eFYtxum9DlOIn9N0BtoH8wY6pUCQY4HxgiIuk4T3H3BaYCUSJSfNOh/6MLvsca3PmnAVkc+3EHzx6DcP87oaq7gXdwnkrfJSLN3PiaAbsPjzvA+La502UddwaQoaor3fdzcRJOqMddbADwparuct+HetyXAN+raqaq5gPzcY754B3fZXm+WpFewMX82sj7NiUbwca60+Mo2Qj2ljsdQ8lGsC04DWBV3Ok2/NoIFlMGsdYG6vpN/w/nP9MTlGx0fNydHkTJRsdVbnl9nDaRaPf1PVDfnXd4o+PAMvqcPwM6uNMPuDGHfNzutucA1/m9D+m4gZ7ABqCWu92ZwPhgHt9B/0MP1ouSCaat+4WnuV9Gdbe8hvs+zZ3f1m/9+3Ba1DfhdwUA54rCt+68+8oo1rbul7nGPYDuc8sb4DRYbwaW+x28gtOp13fAOiDeb1vXu79P2mF/PPHAenedZzmsYfYUYo8DkoG1wLvuH1pFiLs2zn/z0/zKKkLcDwIb3W2/5iaJoB3f9qiAMcYzla0NxhhTjizBGGM8YwnGGOMZSzDGGM9YgjHGeMYSjDHGM5ZgjDGe+X8Gc1lVlzA3BgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(loans_income.mean())\n",
    "np.random.seed(seed=3)  \n",
    "# create a sample of 20 loan income data\n",
    "sample20 = resample(loans_income, n_samples=20, replace=False)\n",
    "print(sample20.mean())\n",
    "results = []\n",
    "for nrepeat in range(500):\n",
    "    sample = resample(sample20)\n",
    "    results.append(sample.mean())\n",
    "results = pd.Series(results)\n",
    "\n",
    "confidence_interval = list(results.quantile([0.05, 0.95]))\n",
    "ax = results.plot.hist(bins=30, figsize=(4, 3))\n",
    "ax.plot(confidence_interval, [55, 55], color='black')\n",
    "for x in confidence_interval:\n",
    "    ax.plot([x, x], [0, 65], color='black')\n",
    "    ax.text(x, 70, f'{x:.0f}', \n",
    "            horizontalalignment='center', verticalalignment='center')\n",
    "ax.text(sum(confidence_interval) / 2, 60, '90% interval',\n",
    "        horizontalalignment='center', verticalalignment='center')\n",
    "\n",
    "meanIncome = results.mean()\n",
    "ax.plot([meanIncome, meanIncome], [0, 50], color='black', linestyle='--')\n",
    "ax.text(meanIncome, 10, f'Mean: {meanIncome:.0f}',\n",
    "        bbox=dict(facecolor='white', edgecolor='white', alpha=0.5),\n",
    "        horizontalalignment='center', verticalalignment='center')\n",
    "ax.set_ylim(0, 80)\n",
    "ax.set_ylabel('Counts')\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Counts')"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAADGCAYAAADMvwX2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAlnUlEQVR4nO3de5xO9dr48c9lME6bYRByiJ2ohBgZg5lx2iTU3ikU6bAffukkqSi/hx3166SiHjueTaidUNmlHWXKKHLeMaOMbZx248w4m+bk+v2x1txmzAwzk3XfM+Z6v17zsu7vOl33Pbdr1vqu77qWqCrGGFNYZQIdgDGmZLLkYY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OifCQ5WPIwJh9Tpkzh0UcfLfDy69ev59ChQ7Rp04aDBw8SFxfHBx98wOTJkxk1alSOZceOHesbI3IxMTExdOvWzZcosowePZrRo0cD8Ic//IHnnnuO5s2bU65cOZo3b57vUPtXXnnFt95vZcnDmDycOHGCzZs307FjxwItn5SUxMiRI5kzZw4AISEhtG3blmrVqtGiRQsOHz7sW3bWrFlkZGQwePDgS2534cKF3HXXXTnaxo8fT3h4OJGRkYBTHmDmzJkkJCRQo0YNlixZkudQ+x07dgBwzTXXFOg9XYq/RpgGxKZNm3wDj7LcfffdjBgxgrNnz9K7d+9c69x///3cf//9HDlyJM96Cw8//DADBgzgl19+YciQIbnmP/XUU/Tt25dt27YxfPjwXPPHjRtH9+7d2bRpk29EZXYvvfQSERER/PDDDzz33HO55r/11lu0bt2amJgYJk2alGv+9OnTadasGYsXL2by5Mm55r///vs0aNCA+fPn+zrxsvv444+pWbMms2fPZvbs2bnmf/nll1SqVIlp06axYMGCXPOzBni9/vrrvk7GLBUrVmTJkiUATJw4kW+++SbH/J9++okbb7wx1zYDISEhgaSkJHr16kViYiKLFy/mpptuolGjRrmWPXXqFAMHDmT69OnUrl0bcGqAHDlyhPT0dA4ePEi1atUA5yjgk08+4bPPzl9kTElJ4ezZs757aLKkp6ezfv16Zs48/1DF2bNnk5SUlKNNValZsyYANWvW5MSJE76h9gATJkyga9eubN68mZ9++olevXoRHx9PYmIiMTExed4NXBBXdPIwpqjat2/PmjVrAOc/X1hYGI0aNSI2NpZJkybx73//m+7duzN37lxmzpzJrl27fKc4f/nLX4iKiuLpp5+mS5cuZGZmMmXKFMC52hISEkL37t19yTTrrt2JEyfmiCEmJoauXbv6TlkyMzMZNmwY7dq1Izo6msaNG/Pee+8xZswYhg8fTtmyZalevTpjxozJc6g9wJ/+9CfA+SM5evToIicOwK62mOIj0L+z1atXa8uWLXX69Ol+3e9rr72mCQkJft1ndk8//bQ2a9ZMz5w5k2seF7na4pd7W36rsLAw3bBhQ6HWsfskSh77nRU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t99L8WM1TI0xl50lD2NcsbGxNGjQgBkzZvjaTp8+Ta1atXwjSWfNmkXnzp0JDw9n7NixAKxbt44OHToQGRnJoEGDSE9PB+C+++6jVq1avPPOO77tDR8+nIiICMLDw1m2bFm+saxevZro6Giio6O57rrrePLJJwFYuXIlERERdOrUifj4eMB5Tkx4eDjh4eG+QWubN28mIiKCqKgo+vbty5kzZwC48847iYqKon379r7n177xxhvUqVOHLVu2FO4Dy++ZDMXp53I/tyXQzwcpjQrymQf697J8+XJ96qmncrS9+OKL2rNnT128eLGqqqampvrmRUVF6S+//KL79u3Ts2fPqqrqmDFjdOHChaqqunfvXn3vvff07bff9q2T9ZT75ORkbdeuXYHiGjp0qMbGxqqqamRkpCYnJ+uePXv01ltvzbHN1NRUbdGihZ47d07T0tJ8648fP17ff//9HPHv2rVLu3XrlmMf8fHxufbNRZ7bYkcexuTj5MmTxMfHEx4e7msrX748ABkZGVSvXp0aNWpQt25dKlas6Juf9YS3vAaHZT3lPjg4GBG5ZAxpaWmsW7eOzp07k5KSQlBQENWrV6dhw4YkJyfn2Ga5cuV841DKlSvn20ZKSgrNmjXLEf+pU6do0aJFIT6N3LyuYbpbROJFZJOIbHDbrIapKRGmTJnie4Rkdi+//DJNmzaldu3aVKpUyde+Z88evv76a/r27XvJbY8dO9Z3mfdiYmJi6NatG2XKlMk12rVs2bKkpaX5Xr/11lv079/fl5SWLl3KzTffTGxsLNdee61vucjISHr06JHncITC8MeRRxdVba3ne2ythqkp9k6cOMHmzZvp2LFjrnljxowhMTGR/fv3+55ne/LkSYYMGcLs2bNz/NXPy6xZs8jIyGDw4MGXjGPhwoXcddddALlGu2ZkZPiOJL7++mu+//77HON/evXqxY8//sidd97J9OnTfe3fffcd69at49lnn73k/i8mEOM8bgei3ek5QCzw296FMZdZQkICSUlJ9OrVi8TERBYvXsxNN91EnTp1CA4OJigoiMqVK1OpUiUyMjIYOHAg48eP950e5CcmJoZPPvmEzz47X8YmJSWFs2fPEhoammPZ9PR01q9fz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O5HSep1gMqA7283KfJrdglD6Aj0E9EdgMf4Zy6TAFCRCRrXEr2Ie2+4e7u/GrAUfIfBl+g4fFZ3L9yqOohYBHOXcEHRaSuu8+6wKELYyngPve605eKJQlIUtW17uuPcZKJv+PIcivwL1U96L72dxzdgV2qelhV04FPcb43AfmOlFqBPm+62A8QzfkO04Xk7Awb4U4/Qs7OsAXu9I3k7AzbidMRVtadbsz5zrAb89l/ZeB32aZ/wPkL9xo5OwhfdadvI2cH4Tq3vQZOn0V192cXUMOdd2EHYe98YvkeaOZOT3Bj8Hsc7rIfAQ9ke+3XOHDuwv4JqOQuNwd4LBDfkdL8E/AALhpczuTRxP1iJbpfkmC3vYL7OtGd3yTb+s/j9JpvI1uvPc5VgH+7856/yP6buF+cze6X9Xm3PRSnQ3c7EJPtiy84hY52APFAWLZtPejGmHjBf7wwYIu7zjtc0CmabbnWwAYgDviH+58uEHFUxvmrXS1bWyDi+AuQ4C77vpsA/P4dKc0/NsLUGFMkxbHPwxhTAljyMMYUiSUPY0yRWPIwxhSJJQ9jTJFY8jDGFIklD2NMkVjyMMYUyf8HvD/bg7I50B0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(seed=3)\n",
    "# create a sample of 20 loan income data\n",
    "sample20 = resample(loans_income, n_samples=20, replace=False)\n",
    "\n",
    "results = []\n",
    "for nrepeat in range(500):\n",
    "    sample = resample(sample20)\n",
    "    results.append(sample.mean())\n",
    "results = pd.Series(results)\n",
    "\n",
    "confidence_interval = list(results.quantile([0.05, 0.95]))\n",
    "ax = results.plot.hist(bins=30, figsize=(4, 3), color='C1')\n",
    "ax.plot(confidence_interval, [55, 55], color='black', linestyle='--')\n",
    "for x in confidence_interval:\n",
    "    ax.plot([x, x], [0, 60], color='black')\n",
    "ax.text(82000, 50, \n",
    "        f'90% CI\\n[{confidence_interval[0]:.0f}, {confidence_interval[1]:.0f}]',\n",
    "       fontsize='small')\n",
    "\n",
    "confidence_interval = list(results.quantile([0.025, 0.975]))\n",
    "ax = results.plot.hist(bins=30, figsize=(4, 3))\n",
    "ax.plot(confidence_interval, [65, 65], color='black', linestyle='--')\n",
    "for x in confidence_interval:\n",
    "    ax.plot([x, x], [0, 70], color='black')\n",
    "ax.text(82000, 65, \n",
    "        f'95% CI\\n[{confidence_interval[0]:.0f}, {confidence_interval[1]:.0f}]',\n",
    "       fontsize='small')\n",
    "# ax.text(sum(confidence_interval) / 2, 264, '95 % interval',\n",
    "#         horizontalalignment='center', verticalalignment='center')\n",
    "\n",
    "meanIncome = results.mean()\n",
    "ax.plot([meanIncome, meanIncome], [0, 50], color='black', linestyle='--')\n",
    "ax.text(meanIncome, 5, f'Mean: {meanIncome:.0f}',\n",
    "        bbox=dict(facecolor='white', edgecolor='white', alpha=0.5),\n",
    "        horizontalalignment='center', verticalalignment='center')\n",
    "ax.set_ylim(0, 80)\n",
    "ax.set_xlim(37000, 102000)\n",
    "ax.set_xticks([40000, 50000, 60000, 70000, 80000])\n",
    "ax.set_ylabel('Counts')\n",
    "\n",
    "# plt.tight_layout()\n",
    "# plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Normal Distribution\n",
    "## Standard Normal and QQ-Plots\n",
    "The package _scipy_ has the function (`scipy.stats.probplot`) to create QQ-plots. The argument `dist` specifies the distribution, which is set by default to the normal distribution."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAoeUlEQVR4nO3dd3hUZfbA8e9JBKmKAhZWSBRRf6y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d/0JOM+7VcB5PTBAHSAjIPbVQf58HXHq7yQDNYDd/usB64Fq7nI9YEHgtdzlq4Gp7nIPN6YTgXI47+Gq6W7bl+u6+3LHhfNe9MHu8vFABnAmMBDn4VLcOCt7/e8iFr/sYcf48JOqrnKXVwKp7pO1DYB3nEdVAOcXBJzHCDq6yxOB4QHnekdVs/I5PpRzgV9UdQWAuk/0ikhF4GURuQjIAs7J5zyNgbdVNQvYIiLz8tkfnAQyQUTqAAqUCdg2V1V/d2NZi/MWwk15TxFUC+BCfwvKvU4dnGeqxroPGU4L+PmbAJZg4sPBgOUsoDzO7e9udfppCmK/+72wxwdzH/Ab8Bf3vH8U4VxHOHZrXy5g/RBgvqp2EKcmyoKAbbl/PgX5dy9Af1XN80yXiDQGrgXGi8hzqvpGAc6bEKwPJk65rYefROQGONqv8Rd38zKcp5gBugCLC3j8XpwHP3P7FjhdRC51j6nsdhafiNOyycZ5KC85n/AXATe5/R+nA80Ctq0H/uouB74h9ESOlX3okc/5/Q67LZBwZgJ9/PuJyDkiUlFEUoDfVPU1YAxwSYTXTCiWYOJbF+B2EfkCWMOx0pT9gdtE5EucX/hQRaJDHT8JeMDtUK3t31mdEpg3AS+5x8zGaWW8CnR3153HsVZSKO8D3wNrgTdwnmj2+ycwQkQycFojfsOBJ0XkcyJvoYwGvvR38oYwxo3jM3foepR7/qbAF+71bgJGRHjNhGJPU5uYJyLjgY9U9V2vYzEFYy0YY0zUWAvGGBM11oIxxkSNJRhjTNRYgjHGRI0lGGNM1FiCMcZEzf8DADOIwSzl+YwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 288x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(4, 4))\n",
    "\n",
    "norm_sample = stats.norm.rvs(size=100)\n",
    "stats.probplot(norm_sample, plot=ax)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Long-Tailed Distributions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARgAAAEYCAYAAACHjumMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAo0klEQVR4nO3dd5hU1f3H8feHFZQVFAUbSFGjJmgi4GLvkEiIPQZUUEANAv4IaixRjNFgxVhjLKgIykRQgz1WihKN6FI0ihob2A2gqAhK2e/vj3sHZnen7e7cmd2Z7+t59pmZW8+uzMdzzj33XJkZzjkXhWaFLoBzrnh5wDjnIuMB45yLjAeMcy4yHjDOuch4wDjnIuMB42qRZJJ+VM99F0rqnWLd/pLeTratpAsk3VG/EtepfAdJ+jjq87iAB0yRCL+sKyUtl/SFpAmSWhW6XInMbJaZ7Zxi3eVmdiqApC5hyG1Qn/NIGixpbfi3+EbSfEmH1eM4EyRdWp8yuIAHTHE53MxaAT2ACuDCmhvU90vbBP07/Fu0Ae4E7pO0WWGLVHo8YIqQmX0CPAHsCuuaPKdLegd4J1z2W0nvSvpS0iOS2tc4TF9J70taIulqSc3C/XaQNF3S0nBdTFKbGvv2lLRA0leS7pK0UbhvyuaJpIslTQo/Ph++LgtrIQeG5fxpwvZbSlohaYsMf4sqYDzQEtghyXl/ImmmpGWS3pB0RLh8KDAAODcsw6PpzuOS84ApQpI6An2BeQmLjwL2BLpKOgS4AugHbAMsAibXOMzRBLWgHsCRwMnxw4f7tgd+AnQELq6x7wDgUIIv9E4kqUllcED42sbMWpnZc2H5BiZsczwwzcwWpztQWGM7FVhOGK4J65oDjwJPA1sCI4GYpJ3NbBwQA8aGZTi8jr+DwwOm2DwkaRnwL+A54PKEdVeY2ZdmtpIgAMab2Vwz+wE4H9hbUpeE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eMAUtwHAKZJeBd5g/dSUI4Ehkl4j+MKnmnw61f6TgXPCDtUd4htbMAVmf+Cv4T7PENQybgYGhct+zPpaUioPAu8AC4C7gX8nrLsEuEFSJUFtJG4scIWkeWRfQxkHvBbv5E3hjrAcc8NL17eFxz8IeDU8X3/ghizPWVL8bmrX6EmaADxmZg8UuiyubrwG45yLjNdgnHOR8RqMcy4yHjDOuch4wDjnIuMB45yLjAeMcy4y/w8JYnE4yJOapAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 288x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sp500_px = pd.read_csv(SP500_DATA_CSV)\n",
    "\n",
    "nflx = sp500_px.NFLX\n",
    "nflx = np.diff(np.log(nflx[nflx>0]))\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(4, 4))\n",
    "stats.probplot(nflx, plot=ax)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Binomial Distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0729\n"
     ]
    }
   ],
   "source": [
    "print(stats.binom.pmf(2, n=5, p=0.1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.99144\n"
     ]
    }
   ],
   "source": [
    "print(stats.binom.cdf(2, n=5, p=0.1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Poisson and Related Distribution\n",
    "## Poisson Distributions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD4CAYAAADrRI2NAAAAOXRFWHRTb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AVwOXdiouDgKuqatEsnVyEjgauG3UFy4BPV9UXho200x8CV3QHYt8C3jxwHmDnP5CnA28bOssOVXVrkquBDcBjwNdYwEs3HLDLOSVJczuQp3okSXOw+CWpMRa/JDXG4pekxlj8ktQYi1+SGmPxS1Jj/h98ux7vWddpywAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sample = stats.poisson.rvs(2, size=100)\n",
    "\n",
    "pd.Series(sample).plot.hist()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exponential Distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD4CAYAAADrRI2NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPwklEQVR4nO3dfYxldX3H8feHXQwPPiAybjcsOFgJllR56Iga1CoUi10F2loqUbMxxDUpbSA00dU0Vf9ogn9UtE3buAXb9QFFQYSKta6IWpMK7CLybEG61F2BXR/IgjFS8Ns/5qDDOjtzZtlz7wy/9yuZzDnn3nN/n51sPnPmd885N1WFJKkd+4w7gCRptCx+SWqMxS9JjbH4JakxFr8kNWb5uAP0ccghh9Tk5OS4Y0jSkrJ58+YfVtXErtuXRPFPTk6yadOmcceQpCUlyb2zbXeqR5IaM+gRf5ItwEPAY8CjVTWV5GDgUmAS2AKcWVU/GTKHJOlXRnHE/5qqOraqprr1dcA1VXUkcE23LkkakXFM9ZwObOiWNwBnjCGDJDVr6OIv4MtJNidZ221bUVX3dcv3Aytm2zHJ2iSbkmzasWPHwDElqR1Dn9XziqraluS5wMYkd858sKoqyax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G4szzVJHkW8CrgYoCqemQplH7nZOB7Q5Y+LN3in+22D4u2mJayJJPAccB1Y44yp27a5CZgO7CxqhZ1XuBDwDuBX4w5R18FfDnJ5u52KovZEcAO4F+6qbSLkhw47lA9vQn41NCDLNXi1wgkeTpwOXBeVe0cd565VNVjVXUs01eCn5Bk0U6pJXk9sL2qNo87ywK8oqqOZ/quuud005eL1XLgeOCfquo44KfAon4fEKCbkjoN+OzQYy3V4ve2DwPr5sovBz5ZVZ8bd56+uj/prwVOHXOUuZwInNbNm38aOCnJJ8YbaW5Vta37vh24gunp1sVqK7B1xl99lzH9i2Cxex1wY1U9MPRAS7X4ve3DgLo3Sy8G7qiqD447z3ySTCQ5qFven+k3/e8ca6g5VNW7q2pVVU0y/X/3q1X1ljHH2q0kB3Zv8tNNmbwWWLRnqFXV/cD3kxzVbToZWJQnJuziLEYwzQOL+O6cc9nLt30YXJJPAa8GDkmyFXhvVV083lRzOhF4K3BLN28O8J6q+uL4Is1pJbChOyNiH+AzVbXoT5FcQlYAV0wfD7AcuKSqvjTeSPP6C+CT3YHhPcDbxpxnTt0v1FOAd4xkvKV4Oqckac8t1akeSdIesvglqTEWvyQ1xuKXpMZY/JLUGItfkhpj8UtSY/4frrMGj13V+EoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sample = stats.expon.rvs(0.2, size=100)\n",
    "\n",
    "pd.Series(sample).plot.hist()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  Weibull Distribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD4CAYAAADrRI2NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMu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G7ugoRs++Uk3vYLBmPnvbqeW+fZ3p4zxtf0Jg2G1vbdoH4vueV8HXDFU+y7TjztqTwr+qV0Kohv7uxi4s6rOH2pfNLTYqcDcmQLXAKcleWKSg4FDGXwY1Ns+JNk3yX5z0ww++FvVPf/cGSZnAF8aqvEtGTga+N/uLepXgGOTLOjelh/btY3TZkdWu1I/DhlLv3WPbUpydPd39Jah59opSY4D/hI4qap+PtQ+k8HvYpDkEAb9du92aplvf3e2xrG8tt1/ajcCfzjuGjuvAr5XVb8ewtmV+nGHTeMT5b5uDM6o+D6D/3nfP8HtvoTBW7ZbgZXd7QTgU8BtXfs1wKKhdd7f1XkXQ2dx9LUPDM6C+G53u33uuRmMjd4ArAa+BuzftYfBD+bc0+3DkqHnehuDD9vuBt465r7cl8HR29OH2qbajwz+E1oH/JLBeO3bx9lvwBIGgXcP8I9036gfQ413MxgPn/ub/Hi37Ou7v4GVwC3Aa7dXy3z7O4Yax/badn/jN3f7fSXwxHHU2LV/EvjTLZadSj+O4+YlGySpMXvSUI8kaQQGvyQ1xuCXpMYY/JLUGINfkhpj8EtSYwx+SWrM/wH2NGBoohLEOgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sample = stats.weibull_min.rvs(1.5, scale=5000, size=100)\n",
    "\n",
    "pd.Series(sample).plot.hist()\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
